home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / LDB171.ARJ / EXAMP503.CPP < prev    next >
Text File  |  1992-05-12  |  582b  |  24 lines

  1.      // examp503.cpp - link with strbdr.obj and binder.obj
  2.      // rework of examp502.cpp
  3.  
  4.      #define sfile "examp503.txt"
  5.  
  6.      #include <string.h>
  7.      #include "strbdr.hpp"
  8.  
  9.      main()
  10.      {
  11.        StrBdr sb(BDR_DDELETE | BDR_DNEW | BDR_DSTORE);
  12.  
  13.        sb.ins(strdup("line one"));
  14.        sb.insNew("line two");
  15.        sb.save(sfile);
  16.  
  17.        StrBdR sB = new StrBdr(sfile);
  18.        if (!sB)  return 1;
  19.        sB->setCurNode();      // reset current node
  20.        while (sB->next())  cout << (char *)*sB << "\n";
  21.        delete sB;
  22.        return 0;
  23.      }
  24.